<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * @category   design_default
 * @package    Mage
 * @copyright  Copyright (c) 2004-2007 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
?>
<?php 
/**
 * Category left navigation
 * 
 * @see Mage_Catalog_Block_Navigation
 */
?>
<div class="block-header-sp1"></div>
<div id="nav_categories" class="left-categories  block block-allcategories block-content-sp1">
	<div  class="block-title"><h2><?php echo $this->__("All Categories");?></h2></div>
	<div  class="categories-menu block-content">
		<ul id="navmenu-v">
			<?php 
			$category_counter = 0;
			foreach ($this->getStoreCategories() as $_category): 
			?>
				<?php $is_parent = $this->hasChildren($_category); ?>			
				<li <?php if($is_parent) { echo ' class="is_parent"'; } else echo ' class="not_parent"'; ?>>					
				<?php if( ($_category->getIsActive()) ): ?>
				<h3><a href="<?php echo $this->getCategoryUrl($_category); ?>" title="<?php echo Mage::app()->getHelper("catalog/category")->htmlEscape( $_category->getName() );?>"><?php echo $_category->getName();?></a></h3>
					<?php if( $_category->hasChildren() ):?>
						<?php $collection = $_category->getChildren();?>
						<?php is_string( $collection ) && $collection = $_category->getChildrenCategories();//catalog flat category?>
						<ul>
						   <?php $is_top = 1;?>
						   <?php foreach ($collection as $firt_subcategory): ?>				   
						   <?php $is_parent = $this->hasChildren($firt_subcategory); ?>
						   <?php if( ($firt_subcategory->getIsActive()) ): ?>
							<li class="first_ul_li <?php if($is_parent) { echo 'is_parent'; } ?> <?php if( $is_top ) echo "top_li"?>">
								<a href="<?php echo $this->getCategoryUrl($firt_subcategory); ?>"><?php echo $firt_subcategory->getName();?></a>
							</li>    
							<?php $is_top = 0;?>
							<?php endif; ?>       
						   <?php endforeach; ?>
						</ul>
					<?php endif; ?>
				<?php endif; ?>
			</li>
			<?php endforeach ?>
		</ul>
	</div>
</div>
<div class="block-bottom-sp1"></div>

<script language="JavaScript" type="text/javascript">
$j(document).ready(function(){ $j("#navmenu-v .is_parent").hover( function() { $j(this).addClass("iehover");}, function() { $j(this).removeClass("iehover"); } ); });
</script>